import request from "@/utils/request.js";

//用户登录
export const userLogin = (data) => request.post("/user/login", data);

//更新图片
export const updateAvatar = (data) => request.put("/user/avatar", data);

//发送手机验证码
export const sendPhoneCode = (data) => request.post("/user/sendPhoneCode", data);

//发送邮箱验证码
export const sendEmailCode = (data) => request.post("/user/sendEmailCode", data);

//注册第一步获取手机号和验证码
export const verifyCode = (data) => request.post("/user/verifyCode", data);

//更新密码
export const updatePassword = (data) => request.patch("/user/updatePassword", data);

//更新手机号码
export const updatePhone = (data) => request.patch("/user/updatePhone", data);

//更新邮箱
export const updateEmail = (data) => request.patch("/user/updateEmail", data);

//上传图片
export const uploadImage = (data,config) => {
    return request.post("/user/uploadPicture", data,{
    headers: {
        'Content-Type': 'multipart/form-data'
    },
    ...config
})}